package ac.neec.db.service;

import java.io.IOException;
import java.util.List;

import ac.neec.data.MajorHeading;
import ac.neec.data.RecordDate;
import ac.neec.data.RecordDetail;
import ac.neec.data.SpecificActivities;
import ac.neec.listener.ProgressListener;
import android.content.Context;

public class SQLManager {
	private static DBOpenHelper helper;

	public SQLManager(Context context) {
		helper = new DBOpenHelper(context);
	}

	public static void execInsert(ProgressListener listener) {
		try {
			helper.execInsertSql(listener);
		} catch (IOException e) {
			e.printStackTrace();
		}
	}

	public static List<MajorHeading> selectMajorHeadingAll() {
		return helper.selectMajorHeadingAll();//dai
	}

	public static MajorHeading selectMajorHeadingMatch(int headingID) {
		return helper.selectMajorHeadingMatch(headingID);
	}

	public static List<List<SpecificActivities>> selectSpecificActivitiesCategories() {
		return helper.selectSpecificActivitiesCategories();
	}

	public static List<SpecificActivities> selectSpecificActivitiesAll() {
		return helper.selectSpecificActivitiesAll();//tyuu
	}

	public static List<RecordDate> selectRecordDateAll() {
		return helper.selectRecordDateAll();
	}

	public static List<RecordDetail> selectRecordDetailAll() {
		return helper.selectRecordDetailAll();
	}

	public static SpecificActivities selectSpecificActivitiesmMatch(int paramActID){
		return helper.selectSpecificActivitiesMatch(paramActID);
	}
	public static RecordDate selectRecordDateMatch(int dateID) {
		return helper.selectRecordDateMatch(dateID);
	}

	public static RecordDetail selectRecordDetailMatch(int detailID) {
		return helper.selectRecordDetailMatch(detailID);
	}

	public static int insertRecordDate(String date) {
		return helper.insertRecordDate(date);
	}

	public static int insertRecordDetail(int dataID, int activitiesID, String time,int heartRateTheory, int heartRatePoint,
			float calorieTheory, float caloriePoint, byte[] graph) {
		return helper.insertRecordDetail(dataID, activitiesID, time, heartRateTheory, heartRatePoint, calorieTheory,
				caloriePoint, graph);
	}

	public static boolean deleateRecordData(int dataID) {
		return helper.deleteRecordData(dataID);
	}

	public static boolean deleateRecordDetail(int detailID) {
		return helper.deleteRecordDetail(detailID);
	}

}
